package Test;

import java.util.ArrayList;

import org.junit.Test;

import DBLayer.DBLogbook;
import ModelLayer.Logbook;

public class TestDBLogbook 
{
	DBLogbook dbl = new DBLogbook();
	ArrayList<Logbook> loglist = dbl.getAllLogbook(false);

	@Test
	public void testGetAllLogbook() {
	    System.out.println("\nLogbook size : " + loglist.size() + "\n");
	    int id = 1;
		while(id <= loglist.size())
		{
			Logbook log = dbl.searchLogbookID(id, false);
			System.out.println("LogbookID    : " + log.getLogbookID());
			System.out.println("Date         : " + log.getDate());
			System.out.println("Note         : " + log.getNote());
			System.out.println("----------------------------");
			id++;
		}
	}

	@Test
	public void testSearchLogbookID() {
		int id = 1;
		Logbook log = dbl.searchLogbookID(id, false);
		System.out.println("Date         : " + log.getDate());
		System.out.println("Note         : " + log.getNote());
		System.out.println("----------------------------");
	}
}
